package thread.threadmethod;

/**
 * Thread.sleep(long l)
 * 当前线程休眠若干毫秒，时间到，自动唤醒
 */
public class Demo02ThreadMethodSleep {
    public static void main(String[] args) {

        //五秒之后，下列线程才会执行
        new Thread(() -> {
            try {
                Thread.sleep(5000);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
            System.out.println("子线程：" + Thread.currentThread().getName());
        }).start();
    }
}
